.class public Lcom/xingbook/ting/lyric/LyricView;
.super Landroid/widget/ScrollView;


# instance fields
.field public a:Lcom/xingbook/ting/lyric/h;

.field public b:I

.field c:Ljava/util/Timer;

.field public d:Z

.field e:Lcom/xingbook/ting/lyric/i;

.field private f:Ljava/util/List;

.field private g:Lcom/xingbook/ting/lyric/d;

.field private h:Landroid/widget/LinearLayout;

.field private i:Z

.field private j:Landroid/media/MediaPlayer;


# direct methods
.method public constructor <init>(Landroid/app/Activity;)V
    .locals 2

    const/4 v1, 0x0

    invoke-virtual {p1}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Landroid/widget/ScrollView;-><init>(Landroid/content/Context;)V

    iput-boolean v1, p0, Lcom/xingbook/ting/lyric/LyricView;->i:Z

    const/16 v0, 0x7d0

    iput v0, p0, Lcom/xingbook/ting/lyric/LyricView;->b:I

    iput-boolean v1, p0, Lcom/xingbook/ting/lyric/LyricView;->d:Z

    new-instance v0, Lcom/xingbook/ting/lyric/i;

    invoke-direct {v0, p0}, Lcom/xingbook/ting/lyric/i;-><init>(Lcom/xingbook/ting/lyric/LyricView;)V

    iput-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->e:Lcom/xingbook/ting/lyric/i;

    invoke-virtual {p0, p1}, Lcom/xingbook/ting/lyric/LyricView;->a(Landroid/content/Context;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0, p1, p2}, Landroid/widget/ScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    iput-boolean v1, p0, Lcom/xingbook/ting/lyric/LyricView;->i:Z

    const/16 v0, 0x7d0

    iput v0, p0, Lcom/xingbook/ting/lyric/LyricView;->b:I

    iput-boolean v1, p0, Lcom/xingbook/ting/lyric/LyricView;->d:Z

    new-instance v0, Lcom/xingbook/ting/lyric/i;

    invoke-direct {v0, p0}, Lcom/xingbook/ting/lyric/i;-><init>(Lcom/xingbook/ting/lyric/LyricView;)V

    iput-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->e:Lcom/xingbook/ting/lyric/i;

    invoke-virtual {p0, p1}, Lcom/xingbook/ting/lyric/LyricView;->a(Landroid/content/Context;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    iput-boolean v1, p0, Lcom/xingbook/ting/lyric/LyricView;->i:Z

    const/16 v0, 0x7d0

    iput v0, p0, Lcom/xingbook/ting/lyric/LyricView;->b:I

    iput-boolean v1, p0, Lcom/xingbook/ting/lyric/LyricView;->d:Z

    new-instance v0, Lcom/xingbook/ting/lyric/i;

    invoke-direct {v0, p0}, Lcom/xingbook/ting/lyric/i;-><init>(Lcom/xingbook/ting/lyric/LyricView;)V

    iput-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->e:Lcom/xingbook/ting/lyric/i;

    invoke-virtual {p0, p1}, Lcom/xingbook/ting/lyric/LyricView;->a(Landroid/content/Context;)V

    return-void
.end method

.method static synthetic a(Lcom/xingbook/ting/lyric/LyricView;)Ljava/util/List;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->f:Ljava/util/List;

    return-object v0
.end method

.method static synthetic a(Lcom/xingbook/ting/lyric/LyricView;Z)V
    .locals 0

    iput-boolean p1, p0, Lcom/xingbook/ting/lyric/LyricView;->i:Z

    return-void
.end method

.method static synthetic b(Lcom/xingbook/ting/lyric/LyricView;)Lcom/xingbook/ting/lyric/d;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    return-object v0
.end method

.method static synthetic c(Lcom/xingbook/ting/lyric/LyricView;)Z
    .locals 1

    iget-boolean v0, p0, Lcom/xingbook/ting/lyric/LyricView;->i:Z

    return v0
.end method

.method static synthetic d(Lcom/xingbook/ting/lyric/LyricView;)Landroid/media/MediaPlayer;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->j:Landroid/media/MediaPlayer;

    return-object v0
.end method


# virtual methods
.method public a()V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->f:Ljava/util/List;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    iget-boolean v0, v0, Lcom/xingbook/ting/lyric/d;->b:Z

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget-object v1, p0, Lcom/xingbook/ting/lyric/LyricView;->f:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    iget-object v2, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget v2, v2, Lcom/xingbook/ting/lyric/h;->h:I

    mul-int/2addr v1, v2

    invoke-virtual {p0}, Lcom/xingbook/ting/lyric/LyricView;->getHeight()I

    move-result v2

    div-int/lit8 v2, v2, 0x2

    add-int/2addr v1, v2

    iget-object v2, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget v2, v2, Lcom/xingbook/ting/lyric/h;->j:I

    add-int/2addr v1, v2

    iget-object v2, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget v2, v2, Lcom/xingbook/ting/lyric/h;->g:F

    float-to-int v2, v2

    add-int/2addr v1, v2

    invoke-virtual {v0, v1}, Lcom/xingbook/ting/lyric/h;->setHeight(I)V

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget-object v1, p0, Lcom/xingbook/ting/lyric/LyricView;->f:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    iget-object v2, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget v2, v2, Lcom/xingbook/ting/lyric/h;->h:I

    mul-int/2addr v1, v2

    iget-object v2, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget v2, v2, Lcom/xingbook/ting/lyric/h;->j:I

    mul-int/lit8 v2, v2, 0x2

    add-int/2addr v1, v2

    iget-object v2, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget v2, v2, Lcom/xingbook/ting/lyric/h;->g:F

    float-to-int v2, v2

    add-int/2addr v1, v2

    invoke-virtual {v0, v1}, Lcom/xingbook/ting/lyric/h;->setHeight(I)V

    goto :goto_0
.end method

.method public a(Landroid/content/Context;)V
    .locals 5

    const/4 v4, -0x1

    const/4 v3, -0x2

    const/4 v0, 0x0

    instance-of v1, p1, Landroid/app/Activity;

    if-eqz v1, :cond_0

    move-object v0, p1

    check-cast v0, Landroid/app/Activity;

    :cond_0
    new-instance v1, Landroid/widget/LinearLayout;

    invoke-direct {v1, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/xingbook/ting/lyric/LyricView;->h:Landroid/widget/LinearLayout;

    iget-object v1, p0, Lcom/xingbook/ting/lyric/LyricView;->h:Landroid/widget/LinearLayout;

    new-instance v2, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v2, v4, v3}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v1, v2}, Landroid/widget/LinearLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    new-instance v1, Lcom/xingbook/ting/lyric/h;

    if-eqz v0, :cond_1

    :goto_0
    invoke-direct {v1, p0, v0}, Lcom/xingbook/ting/lyric/h;-><init>(Lcom/xingbook/ting/lyric/LyricView;Landroid/content/Context;)V

    iput-object v1, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    new-instance v1, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v1, v4, v3}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v0, v1}, Lcom/xingbook/ting/lyric/h;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->h:Landroid/widget/LinearLayout;

    iget-object v1, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->h:Landroid/widget/LinearLayout;

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/lyric/LyricView;->addView(Landroid/view/View;)V

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/lyric/LyricView;->setVerticalScrollBarEnabled(Z)V

    return-void

    :cond_1
    move-object v0, p1

    goto :goto_0
.end method

.method public a(Landroid/media/MediaPlayer;)V
    .locals 2

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->e:Lcom/xingbook/ting/lyric/i;

    invoke-virtual {v0, v1}, Lcom/xingbook/ting/lyric/i;->removeMessages(I)V

    if-nez p1, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iput-object p1, p0, Lcom/xingbook/ting/lyric/LyricView;->j:Landroid/media/MediaPlayer;

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    iget-boolean v0, v0, Lcom/xingbook/ting/lyric/d;->b:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/ting/lyric/LyricView;->d:Z

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->e:Lcom/xingbook/ting/lyric/i;

    invoke-virtual {v0, v1}, Lcom/xingbook/ting/lyric/i;->sendEmptyMessage(I)Z

    goto :goto_0
.end method

.method public b()V
    .locals 3

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->e:Lcom/xingbook/ting/lyric/i;

    invoke-virtual {v0, v2}, Lcom/xingbook/ting/lyric/i;->removeMessages(I)V

    iput-boolean v2, p0, Lcom/xingbook/ting/lyric/LyricView;->d:Z

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    const/4 v1, -0x1

    iput v1, v0, Lcom/xingbook/ting/lyric/h;->i:I

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    iget-boolean v0, v0, Lcom/xingbook/ting/lyric/d;->b:Z

    if-eqz v0, :cond_0

    invoke-virtual {p0, v2, v2}, Lcom/xingbook/ting/lyric/LyricView;->scrollTo(II)V

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    invoke-virtual {v0}, Lcom/xingbook/ting/lyric/h;->postInvalidate()V

    :cond_0
    return-void
.end method

.method public c()V
    .locals 2

    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/xingbook/ting/lyric/LyricView;->d:Z

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->e:Lcom/xingbook/ting/lyric/i;

    invoke-virtual {v0, v1}, Lcom/xingbook/ting/lyric/i;->removeMessages(I)V

    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 4

    const/4 v1, 0x1

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->c:Ljava/util/Timer;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->c:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    :cond_0
    iput-boolean v1, p0, Lcom/xingbook/ting/lyric/LyricView;->i:Z

    :cond_1
    :goto_0
    invoke-super {p0, p1}, Landroid/widget/ScrollView;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    return v0

    :cond_2
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    if-ne v0, v1, :cond_1

    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->c:Ljava/util/Timer;

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->c:Ljava/util/Timer;

    new-instance v1, Lcom/xingbook/ting/lyric/g;

    invoke-direct {v1, p0}, Lcom/xingbook/ting/lyric/g;-><init>(Lcom/xingbook/ting/lyric/LyricView;)V

    iget v2, p0, Lcom/xingbook/ting/lyric/LyricView;->b:I

    int-to-long v2, v2

    invoke-virtual {v0, v1, v2, v3}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V

    goto :goto_0
.end method

.method public setLyric(Lcom/xingbook/ting/lyric/d;)V
    .locals 2

    iput-object p1, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->g:Lcom/xingbook/ting/lyric/d;

    iget-object v0, v0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    iput-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->f:Ljava/util/List;

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    const/4 v1, -0x1

    iput v1, v0, Lcom/xingbook/ting/lyric/h;->i:I

    iget-boolean v0, p1, Lcom/xingbook/ting/lyric/d;->b:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/LyricView;->j:Landroid/media/MediaPlayer;

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/lyric/LyricView;->a(Landroid/media/MediaPlayer;)V

    :cond_0
    return-void
.end method
